import { Request } from "../until/request"


//登录接口
export const login = (data) => Request({
    url: `/api/user/login.do`,
    method: "POST",
    params:data
})

//主页请求
export const home = ()=>Request({
    url:"/api/statistic/base_count.do",
    method:"GET"
})

//商品管理
export const commodity=(data)=>Request({
    url:`/api/product/list.do`,
    method:"GET",
    params:data
})

//商品查看 productId
export const deatil=(data)=>Request({
    url:`/api/product/detail.do?productId=${data}`,
    method:"GET"
})


//品类管理
export const category=()=>Request({
    url:"/api/category/get_category.do",
    method:"GET"
})
//品类添加
export const addcategory=(data)=>Request({
    url:"/api/category/add_category.do",
    method:"POST",
    params:data
})
//修改品类名称
export const setcategory=(data)=>Request({
    url:"/api/category/set_category_name.do",
    method:"POST",
    params:data
})
//查看子品类
export const categoryItem=(data)=>Request({
    url:"/api/category/get_deep_category.do",
    method:"POST",
    params:data
})

//订单管理
export const order=(data)=>Request({
    url:`/api/order/list.do?pageNum=${data}`,
    method:"GET"
})

//用户管理
export const users=()=>Request({
    url:`/api/user/list.do`,
    method:"post"
})
//用户分页
export const userssear=(data)=>Request({
    url:`/api/user/list.do`,
    method:"post",
    params:data
})


//商品管理搜索
export const commSearchname = (data)=>Request({
    url:`/api/product/search.do`,
    method:"GET",
    params:data
})

//新增商品product/save.do
export const addComm = (form)=>Request({
    url:`/api/product/save.do`,
    method:"POST",
    params:form
})

//商品编辑
export const updataComm = (form)=>Request({
    url:`/api/product/save.do`,
    method:"POST",
    params:form
})

//商品上架，下架
export const dataComm = (form)=>Request({
    url:`/api/product/set_sale_status.do`,
    method:"POST",
    params:form
})

//订单查询
export const orderId = (orderid)=>Request({
    url:`/api/order/search.do?orderNo=${orderid}`,
    method:"GET"
})

//上传图片
export const upimage = (data)=>Request({
    url:`/api/product/upload.do`,
    method:"POST"
})

//品类1
export const category1 = (data)=>Request({
    url:`/api/category/get_category.do`,
    method:"GET",
    params:data
})


